package me.zhulu.date;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 * User: herosea
 * Date: 14-5-24
 * Time: 下午1:39
 * To change this template use File | Settings | File Templates.
 */
public class DateEquals {

    public static void main(String[] args) throws ParseException {
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
        Date date = dateFormat.parse("2014-02-06");
        Date date2 = dateFormat.parse("2014-02-06");
        System.out.println("equals:" + date.equals(date2));
        System.out.println("before:" + date.before(date2));
        System.out.println("before:" + date2.before(date));
    }
}
